const { ccclass, property } = cc._decorator;
import PeripheralSystemDataMgr from "./PeripheralSystemDataMgr"
import EngineUtil from "./EngineUtil"
import BasePageCtrl from "./BasePageCtrl"
import DeductionToastPage from "./DeductionToastPage"

@ccclass
export default class DeductionToastPageCtrl extends BasePageCtrl {
private ui: DeductionToastPage;

onLoad() {
    super.onLoad();
    this.onUILoad();
    this._animType = EngineUtil.AnimType.NONE;
    this._touchControl = false;
    this._hasPeneLock = true;
    this._hasBlack = false;
    this._hasTouchLock = false;
    this._hasBlackTouch = false;
    this.addButtonListen();
}

start() {}

protected _init() {
    const t = PeripheralSystemDataMgr.getReduceCash();
    this.ui.countLabel.getComponent(cc.Label).string = `-${EngineUtil.getCashBalance(t)}元`;
    this.scheduleOnce(() => {
        this.hide();
        PeripheralSystemDataMgr.checkShowGameStartPage();
    }, 1.5);
}

onUILoad() {
    this.ui = this.node.addComponent(DeductionToastPage);
}

addButtonListen() {}

clickClose() {
    this.hide();
}

static prefabUrl = "DeductionToastPage";
static className = "DeductionToastPageCtrl";
}